# Nginx 部署
FROM nginx:1.26.3
EXPOSE 443
EXPOSE 80
WORKDIR /app



# 复制 SSL 证书和私钥
COPY nginx_conf/certificate.crt /etc/nginx/certs/certificate.crt
COPY nginx_conf/private.key /etc/nginx/certs/private.key

# 替换 Nginx 配置
COPY nginx_conf/nginx.conf /etc/nginx/conf.d/default.conf

# 复制静态文件
RUN rm -rf /usr/share/nginx/html && mkdir /usr/share/nginx/html
# 将项目构建好的 dist 目录内容复制到 Nginx 的 HTML 目录
COPY dist/ /usr/share/nginx/html/

# 启动 Nginx
CMD ["nginx", "-g", "daemon off;"]
